import java.util.Scanner;

public class Main1157 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int p = 0;
        for (int i = 0; i < n; i++) {
            if (arr[p] > arr[i]) {
                p = i;
                System.out.println(p+1);
                if (p == 0) {
                    for (i=0;i<n;i++){
                        System.out.print(arr[i]+" ");
                    }break;
                }
                else {
                    int t = arr[p];
                    arr[p] = arr[0];
                    arr[0] = t;
                }
                for (i=0;i<n;i++){
                    System.out.print(arr[i]+" ");

                }
            }
        }
    }
}
